<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="content-type" content="text/html; charset=UTF-8">
    <title>学生选课系统登录</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

</head>
<body>
    <input id="account" />
    <input id="password" />
    <button id="submit">立即登录</button>
    <script>
        $('#submit').click(
            function () {
                var account = $('#account').val();
                var password = $('#password').val();
                $.ajax({
                    type:"POST",
                    url:"Login",
                    contentType: "application/json; charset=utf-8",
                    data:JSON.stringify({account:account,password:password}),
                    success:function(data){
                        console.log(data)
                        if (data.status!="-1"){
                            alert("登录成功！")
                        }else{
                            alert("登录失败！")
                        }
                    },
                    error:function(jqXHR){
                        console.log("Error: "+jqXHR.status);
                    }
                });
            }
        )

    </script>
</body>
</html>